package com.itkaisa.wallet.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itkaisa.wallet.mapper.TransactionDetailsMapper;
import com.itkaisa.wallet.pojo.TransactionDetails;
import com.itkaisa.wallet.service.TransactionDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author HP
 * @version 1.0
 * @description TODO
 * @date 2023/3/16 8:21
 */
@Service
public class TransactionDetailsImpl extends ServiceImpl<TransactionDetailsMapper, TransactionDetails> implements TransactionDetailsService {

    @Autowired
    private TransactionDetailsMapper transactionDetailsMapper;

    @Override
    public void costType(int userId, Integer amount, String payType) {
        transactionDetailsMapper.costType(userId,amount,"COST");
    }

    @Override
    public void inComeType(int userId, Integer amount, String payType) {
        transactionDetailsMapper.inComeType(userId,amount,"INCOME");
    }

    @Override
    public List<TransactionDetails> getDetails(int userId) {
        List<TransactionDetails> list = transactionDetailsMapper.getDetails(userId);
        return list;
    }
}
